package bean;

public class Book {
    private int id;
    private String bookName, author, press, isbn, category;
    private float price;

    public Book(String bookName, String author, String press, String isbn, String category, float price) {
        this.bookName = bookName;
        this.author = author;
        this.press = press;
        this.isbn = isbn;
        this.category = category;
        this.price = price;
    }

    public Book() {
    }

    public Book(int id, String bookName, String author, String press, String isbn, String category, float price) {
        this.id = id;
        this.bookName = bookName;
        this.author = author;
        this.press = press;
        this.isbn = isbn;
        this.category = category;
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "书号：" + id + "<br/> 书名:" + bookName + "<br/> 作者：" + author + "<br/> 出版社："
                + press + "<br/> isBN" + isbn + "<br/> 图书类别" + category + "<br/> 价格" + price;
    }

    public String toTable() {
        return
                "<table border=\"5\">" +
                        "  <tr>\n" +
                        "    <th>书号</th>\n" +
                        "    <th>书名</th>\n" +
                        "    <th>作者</th>\n" +
                        "    <th>出版社</th>\n" +
                        "    <th>isBN</th>\n" +
                        "    <th>图书类别</th>\n" +
                        "    <th>价格</th>\n" +
                        "  </tr>\n" +
                        "  <tr>" +
                        "  <td>" + id +
                        "  </td><td>" + bookName +
                        "  </td><td>" + author +
                        "  </td><td>" + press +
                        "  </td><td>" + isbn +
                        "  </td><td>" + category +
                        "  </td><td>" + price +
                        "  </tr>\n" +
                        "</table>";
    }
}
